/*
 * @Description:
 * @Author: py
 * @Date: 2024-12-23
 */
export function useDicts() {
    const oSettleStatus = {
        1: '待结算',
        // 2: '待合作商确认',
        // 3: '待运营商确认',
        4: '结算中',
        5: '已结算',
    }
    const oExceptionType = {
        1: '多退',
        2: '少补',
    }
    const oVerifyStatus = {
        1: '待发起',
        2: '待确认',
        3: '结算异常',
        4: '发票上传',
        5: '已完成',
    }
    const dicts = {
        oSettleStatus,
        oExceptionType,
        oVerifyStatus,
    }

    const getDictLabel = (mapKey: string, dicKey: number | string) => {
        if (mapKey in dicts) {
            return dicts[mapKey][dicKey]
        }
        else {
            return ''
        }
    }

    const getDictOptions = (mapKey: string) => {
        if (mapKey in dicts) {
            const targetMap = dicts[mapKey]
            const dictOptions = Object.entries(targetMap).map(([key, val]: [string, string]) => ({
                label: val,
                value: key,
            }))
            return ref(dictOptions)
        }
        else {
            return ref([])
        }
    }

    return { getDictLabel, getDictOptions }
}
